import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import classnames from 'classnames'
class App extends Component {
  state = { // 初始化定义当前组件的一个状态
    status: true
  }
  render () {
    // <button class="btn btn-success"></button>
    // <button class="btn btn-fail"></button>
    const btnClass = classnames({
      btn: true,
      'btn-success': this.state.status,
      'btn-fail': !this.state.status
    })
    return (
      <div className = { btnClass }>
        欢迎来到react的世界
      </div>
    )
  }
}
ReactDOM.render(
  <App />,
  document.getElementById('root')
)